<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件Prop 插槽slot使用</title>
    <script src="../vue.global.js"></script>
    <style>
        .red{
            color:red;
        }
        .font-big{
            font-size: 50px;
        }
    </style>
</head>
<body>

<div id="App">

    <html-a>@@@@</html-a>
    <html-a>$$$$</html-a>
    <html-a>####</html-a>
    <html-a>&&&&</html-a>
    <html-a></html-a>
</div>


<script>


    const htmlA = {//子组件
        data(){  //数据
            return {
                message:"子组件hello"
            }
        },

        props:{
            parentMsg:Object,//限制数据类型
        },

        template:`
<div>{{message}}<slot>默认参数</slot></div>
<!--<div><slot></slot></div>-->
`
    };

    const vm = Vue.createApp({  //根组件

        data(){
            return {
                message:"父组件hello",
                posts:{
                    likes:888,
                    id:999,
                    city:"上海"
                }
            }
        },
        components:{
            'html-a':htmlA
        }
    });
    vm.mount("#App");


</script>
</body>
</html>